<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:c="http://java.sun.com/jsp/jstl/core"
                xmlns:fn="http://java.sun.com/jsp/jstl/functions"
                xmlns:ds="http://deltaset.org/deltaset-faces"
                xmlns:meta="http://deltaset.org/deltaset-meta"
                xmlns:mf="http://java.sun.com/jsf/composite/deltaset.meta/flow"
                xmlns:composite="http://java.sun.com/jsf/composite">

           <h:panelGroup id="detail-row" style="display:block" >                
            <c:set var="detail" value="#{meta.model}"/>
            <h:panelGroup rendered="#{meta.isNew(detail)}" style="text-align: center" layout="block">
                <b>Loading...</b>
            </h:panelGroup>
            <h:panelGroup rendered="#{not meta.isNew(detail)}">
			<div style="text-align: right">
                <c:forEach items="#{meta.contextActions}" var="action">
                    <mf:commandButton metaAction="#{action}"
                                      model="#{detail}"
                                      meta="#{meta}"                                     
                                      />                   
                </c:forEach>               

                <div>
                    <c:forEach items="#{meta.otherContextActions}" var="action">                        
                        <mf:commandButton metaAction="#{action}"
                                          model="#{detail}"
                                          meta="#{meta}"
                                          noVoidShow="executeTemplate"
                                          voidShow="executeTemplate"                                          
                                          style="font-size: 0.8em;"
                                          />
                    </c:forEach>
                </div>
				</div>
                <ds:fieldset>                    
                    <mf:detail-fields fields="#{meta.detailFields}" model="#{detail}" meta="#{meta}" owner="#{meta.modelClass}"/>
                </ds:fieldset>
				<div style="text-align: right">
                <div>
                    <c:forEach items="#{meta.otherContextActions}" var="action">                        
                        <mf:commandButton metaAction="#{action}"
                                          model="#{detail}"
                                          meta="#{meta}"
                                          noVoidShow="executeTemplate"
                                          voidShow="executeTemplate"                                          
                                          style="font-size: 0.8em;"
                                          />
                    </c:forEach>
                </div>
				<c:forEach items="#{meta.contextActions}" var="action">
                    <mf:commandButton metaAction="#{action}"
                                      model="#{detail}"
                                      meta="#{meta}"                                     
                                      />                   
                </c:forEach>               

                
				</div>
            </h:panelGroup>
        </h:panelGroup>

</ui:composition>
